package com.xinchao.job.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.xinchao.job.service.sms.SmsService;


/**
 * 
 * <p>Title: SmsController</p>  
 * <p>Description: 短信回调controller</p>  
 * @author huangf 
 * @date 2018年8月30日
 */
@Controller
@RequestMapping(value = "/sms")
public class SmsController {
	private static Logger logger = LoggerFactory.getLogger(SmsController.class);
	@Autowired
	private SmsService smsService;
	
	/**
	 * 短信发送状态回调
	 * @param request
	 * @param smsMsgId
	 * @param total
	 * @param sequence
	 * @param status
	 * @param source
	 * @param updateTime
	 * @param orgCode
	 */
	@ResponseBody
	@RequestMapping(value = "/callback",method =RequestMethod.POST) 
	public void callBack(HttpServletRequest request,String smsMsgId,String total,String sequence,String status,String source,String updateTime,String orgCode) {
		logger.info("###@smsSendStatusCallBack invoke params "  + JSON.toJSONString(request.getParameterMap()));
		smsService.sendStatusCallBack(smsMsgId, status);
	}
	
}
